package com.apexsoft.assets.base.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * Common exception for biz
 * @author linqz
 * @date 8/24/2018
 */
@EqualsAndHashCode(callSuper = false)
@Data
@ToString
public class BizException extends RuntimeException {
    private Integer code = -1;
    private String causeMsg = "";

    public BizException(String message) {
        super(message);
        this.causeMsg = message;
    }

    public BizException(String message, Throwable cause) {
        super(message, cause);
        this.causeMsg = message;
    }

    public BizException(Integer code, String causeMsg, Throwable cause){
        super(causeMsg, cause);
        this.code = code;
        this.causeMsg = causeMsg;
    }

    public BizException(Integer code, String causeMsg){
        super(causeMsg);
        this.code = code;
        this.causeMsg = causeMsg;
    }
}
